﻿// -----------------------------------------------------------------------
// <copyright file="TestRoutin.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace NetFramework.Router
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using NetFramework.Router.Configuration;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class TestRouting
    {
        public void Test()
        {
            PageInfo page = new PageInfo();
            page.PageName = "Home";
            page.RelatedPath = "Default.aspx";
            page.Site = "WWW";

            PageInfoConfig config = new PageInfoConfig();
            config.Pages = new PageInfo[] { page, page };

            string tmp = Serialization.SerializerManager.XmlSerializer.ToSerializedString(config);

            RouteInfo routeInfo = new RouteInfo();
            routeInfo.Defaults = "default";
            routeInfo.PageName = "page";
            routeInfo.RelatedPath = "Default.aspx";
            routeInfo.Url = "/home";

            PagedRouteInfo pinfo = new PagedRouteInfo();
            pinfo.PageName = "Home";
            pinfo.Routes = new RouteInfo[] { routeInfo };
            pinfo.WebSite = "WWW";

            RouteConfig rconfig = new RouteConfig();
            rconfig.Enabled = true;
            rconfig.PagedRouteInfo = new List<PagedRouteInfo>();
            rconfig.PagedRouteInfo.Add(pinfo);

            tmp = Serialization.SerializerManager.XmlSerializer.ToSerializedString(rconfig);
        }
    }
}
